﻿{include file="Main/menu" /}
<form method="post">
	<div class="panel admin-panel" style="background: #fff">
		<div class="panel-head"><strong>{:lang('currency')['list']}</strong></div>
		<div class="padding border-bottom">
			<script>
			//city 参数和回调
			var pid="{:input('get.pid')}";
			var cid="{:input('get.cid')}";
			var aid="{:input('get.aid')}";
			var selectc=true;
			var selecta=true;
			function select_p(){
				return false;
			}
			function select_c(){
				return false;
			}
			function select_a(){
				location.href="{:url('/admin/order')}?pid="+pid+"&cid="+cid+"&aid="+aid;
			}
			</script>
			{:lang('label')['select']}{:lang('currency')['city']}:{include file="public/city" /}
			{:lang('label')['search']}:
			<a type="button" class="button button border-yellow search"/>{:lang('label')['orderid']}{:lang('label')['search']}</a>
			<!--<a type="button" class="button button border-blue" href="javascript:show_send()"/>发布订单</a>-->
			<a class="button button border-blue" style="float: right;margin-right: 20px" href="javascript:dispatch('&aid={:input(\'get.aid\')}')">订单调度系统</a>
		</div>
		<table class="am-table am-table-striped am-table-hover table-main">
			<tr>
				<th width="120">{:lang('label')['orderid']}</th>
				<th width="30">{:lang('label')['price']}</th>
				<th width="100">类型</th>
				<th width="50">{:lang('label')['status']}</th>
				<th width="200">{:lang('label')['remark']}</th>
				<th width="100">发单{:lang('label')['time']}</th>
				<th width="100">订单总额</th>
				<th width="100">{:lang('label')['handle']}</th>
			</tr>
			{volist name="data" id="order"}
			<tr>
				<td style="line-height:40px">{$order.order_id}</td>
				<td style="line-height:40px">￥{$order.price}</td>
				<td style="line-height:40px">{$order.type}</td>
				<td style="line-height:40px">{if $order.status == "1"}<span class="text-red">{:lang('label')['order_status_1']}</span>{else}<span class="text-sub">{:lang('label')['order_status_'.$order.status]}</span>{/if}</td>
				<td style="line-height:40px">{$order.remark}</td>
				<td style="line-height:40px">{$order.require_time|date="Y-m-d H:i:s",###}</td>
				<td style="line-height:40px">￥{$order.price}</td>
				<td style="line-height:40px">
					{if $order.status == 2}
					<!--<a class="button border-green button-little" href="javascript:dispatch('{$order.order_id}')">调度</a>-->
					{/if}
					<a class="button border-blue button-little" href="javascript:show_detail('{$order.order_id}')">{:lang('currency')['detail']}</a>
				</td>
			</tr>
			{/volist}
		</table>
		{include file="public/pages" /}
	</div>
</form>
<script>
layer.config({
	extend: 'extend/layer.ext.js'
});
function show_send() {
    layer.open({
        type: 2,
        title:'',
        area: ['500px', '610px'], //宽高
        content: '__URL__/send_order'
    });
}
$('#select_del').click(function(){
	var str='';
	$("input:checkbox[name=id]:checked").each(function(){
		str+=$(this).val()+',';
	});
	if(str!=''){
		if(confirm("{:lang('currency')['del']}?")){
		    location.href = 'order/del.html?id='+str;
		}
	}
});
function dispatch(order_id) {
    layer.open({
        type: 2,
        title:'订单调度系统',
        area: ['90%', '90%'], //宽高
        maxmin: true,
        content: '__URL__/dispatch?order_id='+order_id
    });
}
function show_detail(order_id) {
	layer.open({
		type: 2,
		title:'',
		area: ['560px', '450px'], //宽高
		content: '__URL__/detail?order_id='+order_id
	});
}
$('.search').click(function(){
	layer.prompt({
		title:"{:lang('label')['orderid']}{:lang('label')['search']}"
	},function(val){
		location.href='__ROOT__/admin/order.html?orderid='+val;
	});
});
</script>
{include file="Main/menu_footer" /}